
#ifndef CONNEXION_H
#define CONNEXION_H

#include <QObject>
#include <QSqlDatabase>
#include <QProgressBar>
namespace Common {

class Connexion : public QObject
{
    Q_OBJECT
public:
    enum DatabaseDriver {
        Driver_SQLite = 0,
        Driver_MySQL,
        Driver_PostGreSQL,
    };

    Connexion(QObject *parent);
    ~Connexion();
    bool connectToDrTux();
    bool connect();
    bool createDatabaseSchema(const int driver) ;
    bool createDatabase(const int driver) const;
    bool createFirstSqlConnection() const;

    bool isDatabaseCorrupted(const int driver,QSqlDatabase &);
    //bool isAnIndependantProgram();
    
private:
    bool m_IsDBConfigured;
    
};

} // End namespace Common

#endif   // Connexion_H
